home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat2 / standard / chmod.z / chmod
Text File  |  1998-10-20  |  14KB  |  265 lines

  1.  
  2.  
  3.  
  4. cccchhhhmmmmoooodddd((((2222))))                                                              cccchhhhmmmmoooodddd((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _cccc_hhhh_mmmm_oooo_dddd, _ffff_cccc_hhhh_mmmm_oooo_dddd - change mode of file
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>>
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_ssss_tttt_aaaa_tttt_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _cccc_hhhh_mmmm_oooo_dddd_((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_pppp_aaaa_tttt_hhhh_,,,, _mmmm_oooo_dddd_eeee______tttt _mmmm_oooo_dddd_eeee_))))_;;;;
  16.  
  17.      _iiii_nnnn_tttt _ffff_cccc_hhhh_mmmm_oooo_dddd_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _mmmm_oooo_dddd_eeee______tttt _mmmm_oooo_dddd_eeee_))))_;;;;
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      _cccc_hhhh_mmmm_oooo_dddd and _ffff_cccc_hhhh_mmmm_oooo_dddd set the access permission portion of the mode of the
  21.      file whose name is given by _p_a_t_h or referenced by the descriptor _f_i_l_d_e_s
  22.      to the bit pattern contained in _m_o_d_e.  If _p_a_t_h or _f_i_l_d_e_s are symbolic
  23.      links, the access permissions of the target of the symbolic links are
  24.      set.  Access permission bits are interpreted as follows:
  25.  
  26.    _SSSS______IIII_SSSS_UUUU_IIII_DDDD   04000   Set user ID on execution.
  27.    _SSSS______IIII_SSSS_GGGG_IIII_DDDD   020#0   Set group ID on execution if # is _7777, _5555, _3333, or _1111
  28.                      Enable mandatory file/record locking if # is _6666, _4444, _2222, or _0000
  29.    _SSSS______IIII_SSSS_VVVV_TTTT_XXXX   01000   Save text image  after execution (a.k.a. Sticky bit).
  30.    _SSSS______IIII_RRRR_WWWW_XXXX_UUUU   00700   Read, write, execute by owner.
  31.    _SSSS______IIII_RRRR_UUUU_SSSS_RRRR   00400   Read by owner.
  32.    _SSSS______IIII_WWWW_UUUU_SSSS_RRRR   00200   Write by owner.
  33.    _SSSS______IIII_XXXX_UUUU_SSSS_RRRR   00100   Execute (search if a directory) by owner.
  34.    _SSSS______IIII_RRRR_WWWW_XXXX_GGGG   00070   Read, write, execute by group.
  35.    _SSSS______IIII_RRRR_GGGG_RRRR_PPPP   00040   Read by group.
  36.    _SSSS______IIII_WWWW_GGGG_RRRR_PPPP   00020   Write by group.
  37.    _SSSS______IIII_XXXX_GGGG_RRRR_PPPP   00010   Execute by group.
  38.    _SSSS______IIII_RRRR_WWWW_XXXX_OOOO   00007   Read, write, execute (search) by others.
  39.    _SSSS______IIII_RRRR_OOOO_TTTT_HHHH   00004   Read by others.
  40.    _SSSS______IIII_WWWW_OOOO_TTTT_HHHH   00002   Write by others
  41.    _SSSS______IIII_XXXX_OOOO_TTTT_HHHH   00001   Execute by others.
  42.  
  43.      Modes are constructed by _OOOO_RRRR_''''_iiii_nnnn_gggg the access permission bits.
  44.  
  45.      The effective user ID of the process must match the owner of the file or
  46.      the process must be super-user to change the mode of a file.
  47.  
  48.      If the effective user ID of the process is not super-user, the sticky bit
  49.      is cleared for any non-directory argument.
  50.  
  51.      If the effective group ID of the process does not match the group ID of
  52.      the file, and the process is not super-user the mode bit 02000 (set group
  53.      ID on execution) is cleared.
  54.  
  55.      If a directory is writable and the sticky bit, _SSSS______IIII_SSSS_VVVV_TTTT_XXXX, is set on the
  56.      directory, a process may remove or rename files within that directory
  57.      only if one or more of the following is true [see _uuuu_nnnn_llll_iiii_nnnn_kkkk(2) and
  58.      _rrrr_eeee_nnnn_aaaa_mmmm_eeee(2)]:
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. cccchhhhmmmmoooodddd((((2222))))                                                              cccchhhhmmmmoooodddd((((2222))))
  71.  
  72.  
  73.  
  74.           the effective user ID of the process is the same as that of the
  75.           owner ID of the file
  76.  
  77.           the effective user ID of the process is the same as that of the
  78.           owner ID of the directory
  79.  
  80.           the process is a super-user.
  81.  
  82.      Note that the group id of the process and file are not taken into account
  83.      by the rules above.  A process will only be able to remove a file in a
  84.      sticky directory based upon its effective user ID, not its group ID.
  85.  
  86.      In releases of IRIX before 6.2, a process could also remove or rename
  87.      files within a directory with the sticky bit set if the process had write
  88.      permission for the file.  This has been changed in accordance with the
  89.      X/Open XPG4.2 standard, but the old behavior can be enabled via the
  90.      xpg4_sticky_bit kernel tunable variable.
  91.  
  92.      If the sticky bit, _SSSS______IIII_SSSS_VVVV_TTTT_XXXX, is set on a file that is a dynamic loader for
  93.      an _E_L_F executable, then when the executable is _e_x_e_ced the old process's
  94.      read only address spaces will be made available to the dynamic loader in
  95.      the new process.  This can improve program start up time considerably.
  96.  
  97.      The setting of the sticky bit on any other file has no effect.
  98.  
  99.      If the mode bit 02000 (set group ID on execution) is set, the mode bit
  100.      00010 (execute or search by group) is not set, and the file is a regular
  101.      file, file and record locks will be mandatory.  Future calls to _oooo_pppp_eeee_nnnn(2),
  102.      _cccc_rrrr_eeee_aaaa_tttt(2), _rrrr_eeee_aaaa_dddd(2), and _wwww_rrrr_iiii_tttt_eeee(2) will carry implicit locks, and may fail
  103.      or block depending on the presence of other locks on the file.  Mapped
  104.      file access is not affected by mandatory locks.
  105.  
  106.      If the mode bit 02000 is set on a directory, then any files created in
  107.      that directory will take on the group ID of the directory rather than the
  108.      group ID of the calling process.  _mmmm_oooo_uuuu_nnnn_tttt(1M) may be used to enable this
  109.      feature regardless of the mode of the directory. [See _ffff_ssss_tttt_aaaa_bbbb(4)].
  110.  
  111.      Mandatory locking is not supported on NFS or CacheFS.
  112.  
  113.      Upon successful completion, _cccc_hhhh_mmmm_oooo_dddd and _ffff_cccc_hhhh_mmmm_oooo_dddd mark for update the _ssss_tttt______cccc_tttt_iiii_mmmm_eeee
  114.      field of the file.
  115.  
  116.      _cccc_hhhh_mmmm_oooo_dddd will fail and the file mode will be unchanged if one or more of the
  117.      following are true:
  118.  
  119.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS         Search permission is denied on a component of the path
  120.                     prefix of _p_a_t_h.
  121.  
  122.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS         Write permission on the named file is denied.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. cccchhhhmmmmoooodddd((((2222))))                                                              cccchhhhmmmmoooodddd((((2222))))
  137.  
  138.  
  139.  
  140.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT         _p_a_t_h points outside the allocated address space of the
  141.                     process.
  142.  
  143.      _EEEE_IIII_NNNN_TTTT_RRRR          A signal was caught during execution of the system call.
  144.  
  145.      _EEEE_IIII_OOOO            An I/O error occurred while reading from or writing to the
  146.                     file system.
  147.  
  148.      _EEEE_LLLL_OOOO_OOOO_PPPP          Too many symbolic links were encountered in translating
  149.                     _p_a_t_h.
  150.  
  151.      _EEEE_MMMM_UUUU_LLLL_TTTT_IIII_HHHH_OOOO_PPPP      Components of _p_a_t_h require hopping to multiple remote
  152.                     machines and file system type does not allow it.
  153.  
  154.      _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG   The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the
  155.                     length of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while
  156.                     ______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is in effect.
  157.  
  158.      _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR        A component of the prefix of _p_a_t_h is not a directory.
  159.  
  160.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT         Either a component of the path prefix, or the file
  161.                     referred to by _p_a_t_h does not exist or is a null pathname.
  162.  
  163.      _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK        _p_a_t_h points to a remote machine and the link to that
  164.                     machine is no longer active.
  165.  
  166.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT      The named file is located on a remote file system which is
  167.                     not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  168.  
  169.      _EEEE_PPPP_EEEE_RRRR_MMMM          The effective user ID does not match the owner of the file
  170.                     and the process is not super-user.
  171.  
  172.      _EEEE_RRRR_OOOO_FFFF_SSSS          The file referred to by _p_a_t_h resides on a read-only file
  173.                     system.
  174.  
  175.      _ffff_cccc_hhhh_mmmm_oooo_dddd will fail and the file mode will be unchanged if:
  176.  
  177.      _EEEE_BBBB_AAAA_DDDD_FFFF          _f_i_l_d_e_s is not an open file descriptor
  178.  
  179.      _EEEE_IIII_OOOO            An I/O error occurred while reading from or writing to the
  180.                     file system.
  181.  
  182.      _EEEE_IIII_NNNN_TTTT_RRRR          A signal was caught during execution of the _ffff_cccc_hhhh_mmmm_oooo_dddd system
  183.                     call.
  184.  
  185.      _EEEE_NNNN_OOOO_LLLL_IIII_NNNN_KKKK        _f_i_l_d_e_s refers to a remote machine and the link to that
  186.                     machine is no longer active.
  187.  
  188.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT      _f_i_l_d_e_s refers to a file on a remote file system which is
  189.                     not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. cccchhhhmmmmoooodddd((((2222))))                                                              cccchhhhmmmmoooodddd((((2222))))
  203.  
  204.  
  205.  
  206.      _EEEE_PPPP_EEEE_RRRR_MMMM          The effective user ID does not match the owner of the file
  207.                     and the process is not super-user.
  208.  
  209.      _EEEE_RRRR_OOOO_FFFF_SSSS          The file referred to by _f_i_l_d_e_s resides on a read-only file
  210.                     system.
  211.  
  212.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL         The file referred to by _f_i_l_d_e_s resides on NFS or CacheFS
  213.                     and mandatory locking is being enabled.
  214.  
  215. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  216.      _cccc_hhhh_mmmm_oooo_dddd(1), _aaaa_cccc_cccc_eeee_ssss_ssss(2), _cccc_hhhh_oooo_wwww_nnnn(2), _cccc_rrrr_eeee_aaaa_tttt(2), _eeee_xxxx_eeee_cccc(2), _ffff_cccc_nnnn_tttt_llll(2), _mmmm_kkkk_nnnn_oooo_dddd(2),
  217.      _oooo_pppp_eeee_nnnn(2), _rrrr_eeee_aaaa_dddd(2), _ssss_tttt_aaaa_tttt(2), _wwww_rrrr_iiii_tttt_eeee(2), _mmmm_kkkk_ffff_iiii_ffff_oooo(3C), _ssss_tttt_aaaa_tttt(5)
  218.  
  219. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  220.      Upon successful completion, a value of 0 is returned.  Otherwise, a value
  221.      of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  222.  
  223. BBBBUUUUGGGGSSSS
  224.      Due to the overloading of various permission bits, the silent turning off
  225.      of the set group ID on execution bit under the above mentioned
  226.      circumstances may in fact have disabled mandatory file/record locking
  227.      (for files) or group inheritance (for directories).  The only way to
  228.      determine if _cccc_hhhh_mmmm_oooo_dddd really worked in these cases is to _ssss_tttt_aaaa_tttt(2) the file.
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.